package register

import (
	"jlpay-sdk-go/pkg/jlpay/core"
	"jlpay-sdk-go/pkg/jlpay/models/openmerch/register"
	"jlpay-sdk-go/pkg/jlpay/services"
)

// RegisterService 注册服务
type RegisterService struct {
	*services.BaseService
}

// NewRegisterService 创建注册服务实例
func NewRegisterService(config *core.Config) *RegisterService {
	return &RegisterService{
		BaseService: services.NewBaseService(config),
	}
}

// CancelIncoming 取消进件申请
func (s *RegisterService) CancelIncoming(request *register.IncomingCancelRequest) (*register.IncomingCancelResponse, error) {
	response := register.NewIncomingCancelResponse()
	err := s.Post(request, response, "/open/merch/access/incoming/cancel")
	return response, err
}

// QueryIncoming 查询进件申请
func (s *RegisterService) QueryIncoming(request *register.IncomingQueryRequest) (*register.IncomingQueryResponse, error) {
	response := register.NewIncomingQueryResponse()
	err := s.Post(request, response, "/open/merch/access/incoming/query")
	return response, err
}
